Page({
  data: {
    mainTabs: ['热门推荐', '家校协同', '安全普法', '节假日'],
    mainTabIndex: 0,
    subTabs: [
      { name: '全部', count: 29 },
      { name: '通知', count: 3 },
      { name: '接龙', count: 3 },
      { name: '信息采集', count: 5 },
      { name: '投票', count: 3 },
      { name: '打卡', count: 1 }
    ],
    subTabIndex: 0,
    templates: [
      {
        id: 1,
        type: '通知',
        typeClass: 'tag-notice',
        title: '收集图片或文件',
        img: '/assets/template-img1.png',
        hot: 67065
      },
      {
        id: 2,
        type: '通知',
        typeClass: 'tag-notice',
        title: '中秋国庆放假通知',
        img: '/assets/template-img2.png',
        hot: 9443
      },
      {
        id: 3,
        type: '信息采集',
        typeClass: 'tag-info',
        title: '收集文件',
        img: '/assets/template-img3.png',
        hot: 20403
      },
      {
        id: 4,
        type: '信息采集',
        typeClass: 'tag-info',
        title: '学生基本信息收集',
        img: '/assets/template-img4.png',
        hot: 78208
      },
      {
        id: 5,
        type: '信息采集',
        typeClass: 'tag-info',
        title: '课后延时服务意愿统计',
        img: '/assets/template-img5.png',
        hot: 4643
      },
      {
        id: 6,
        type: '投票',
        typeClass: 'tag-vote',
        title: '学生社团选课',
        img: '/assets/template-img6.png',
        hot: 258
      }
      // ...可继续补充
    ]
  },
  onMainTabChange(e) {
    this.setData({ mainTabIndex: e.currentTarget.dataset.index });
    // TODO: 根据主tab切换筛选模板
  },
  onSubTabChange(e) {
    this.setData({ subTabIndex: e.currentTarget.dataset.index });
    // TODO: 根据二级tab切换筛选模板
  }
});

